list_x = [1,2,3,4,5,6,7,8,9]

def square(x):
    return x*x

for x in list_x:
    print(square(x))

#用map_实现(简化循环调用函数)
print(list(map(square,list_x)))
print(list(map(lambda x:x*x,list_x)))   #简洁

list_x = [1,2,3,4,5,6,7,8,9]
list_y = [9,8,7,6,5,4,3,2,1]
print(list(map(lambda x,y:x*x+y,list_x,list_y)))